package atm.physical;


import atm.domain.Cash;

public class CashDispenser{

	private int balance;
	public CashDispenser(int amount){
		this.balance = amount;
		
	}
	//吐钞票、减少ATM总金额
	public Cash spitCash(int amount){
		if(amount <= this.balance){
			this.balance -= amount;
			//this.setDisable(true);
			return new Cash(amount);
		}
		return null;
	}
	
//	//关闭吐钞机
//	public void close(){
////		this.setText("锟截闭筹拷锟斤拷锟斤拷");
//		//this.setDisable(false);
//	}
	
	//setter\getter
	public int getBalance() {
		return balance;
	}
	public void setBalance(int balance) {
		this.balance = balance;
	}
	
}
